<template>
  <div class="child-manage">
    <div class="list">
      <div v-for="(item,index) in lists" :key="index" class="item" @click="router({path: './clockOperation',query:{id:item.id,uid:id}})">
        <p>{{item.txt}}</p>
        <span class="num">{{item.remain}}次</span>
        <img src="@/assets/mddk02.png" alt="">
      </div>
    </div>
    <div class="none" v-show="noDate">
      <img src="@/assets/tykt01.png" alt="">
      <p>暂无相关内容</p>
    </div>
    <toast v-model="is_toast" type="text" width="20em">{{toast_con}}</toast>
  </div>
</template>

<script>
  import {childlist} from '@/api/api'
  import {Toast } from 'vux'
  export default {
    components: {
      Toast
    },
    data () {
      return {
        lists:[],
        is_toast:false,
        toast_con:'默认',
        noDate: false,
      }
    },
    created () {
      this.id = this.$route.query.id
      this.child()
    },
    methods: {
      router (path) {
        this.$router.push(path)
      },
      child(){
        childlist(this.id, '', '', '').then((res) =>{
          this.lists=res.data.info
          console.log(this.lists)
          if(this.lists == null){
            this.noDate = true
          }
        }).catch((err) => {
          console.dir(err)
        })
      },
    }
  }
</script>

<style lang="stylus" scoped>
.child-manage
  min-height 100vh
  background-color #f5f5f5
  padding-bottom 6rem
  box-sizing border-box
  .item
    position relative
    line-height 6rem
    height 6rem
    font-size 1.5rem
    color #333
    padding-left 1.5rem
    background-color #fff
    border-bottom 1px solid #e6e6e6
    .num
      font-size 1.5rem
      line-height 6rem
      position absolute
      right 8.5rem
      top 0
    img
      position absolute
      width 1.75rem
      right 1.5rem
      top 2rem
  .none
    img
      width 7.25rem
      position relative
      left 50%
      margin-left -3.625rem
      top 21rem
    p
      position relative
      top 22.3rem
      text-align center
      color #666
      font-size 1.3rem
</style>
